package org.dna.metronomo.persistence;


import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;

public interface UserMapper {
	@Insert("INSERT INTO User (name, password, role) VALUES (#{name}, #{password}, #{role})")
	void insert(User user);

	@Update("UPDATE User SET password=#{password}, role=#{role} WHERE idUser=#{id}")
	void update(User user);

    @Delete("DELETE FROM User WHERE idUser=#{id}")
	void deleteByID(Integer id);

	@Update("UPDATE User SET status = #{status} WHERE idUser=#{id}")
	void updateStatusByID(@Param("id") Integer id, @Param("status") String status);
}
